<?php
/*
php标准格式；
学习模板！
*/
header("content-type:text/html;charset=UTF-8");
//继承的查找机制
class Goods{
	public $Goods_name='天龙八部';
	public $Goods_price=15;
	public function __construct($Goods_name,$Goods_price){
		$this->Goods_name = $Goods_name;
		$this->Goods_price = $Goods_price;
	}
	public function Getprice(){
		return $this->Goods_price;
	}
}
//book类
class Book extends Goods{
	public $author;
	public $publisher;
	//子类如何访问父类的方法或者属性
	public function getparent(){
		return parent::Getprice();	//使用关键字Parent::来访问父类方法和属性
	}
}
$book1 = new Book('汇编语言',28);
echo $book1->getparent();
?>